<template>
<div id="main" style="background-image: url(static/background.png)">
  <div style="text-align: center; margin-left: 3%; margin-right: 3%; margin-bottom: 5%;">
    <a href="" style="text-decoration: none"><span id="titleText">在线购物系统</span></a>
    <table style="margin: 0 auto; text-align: center; border-spacing: 40px 40px; table-layout: fixed; width: 100%;
     margin-top: 1%; margin-bottom: 30%; background: rgba(245, 245, 245, 0.7); border: 5px; border-radius: 10px; border-style: inset; border: #e4b9c0;
     ">
      <tr>
        <td>
          <a v-on:click="index('发布商品')" style="text-decoration: none" v-if="flag"><div class="sp1" disabled="">发布商品</div></a>
          <el-link disabled class="sp2" v-if="!flag"><a style="text-decoration: none"><div disabled="">发布商品</div></a></el-link>
        </td>
        <td>
          <a v-on:click="index('历史商品')" style="text-decoration: none"><div class="sp1">历史商品</div></a>
        </td>
      </tr>
      <tr>
        <td>
          <a v-on:click="index('购买人信息')" style="text-decoration: none"><div class="sp1">购买人信息</div></a>
        </td>
        <td>
          <a v-on:click="index('商品状态')" style="text-decoration: none"><div class="sp1">处理商品</div></a>
        </td>
      </tr>
    </table>
  </div>
  <div style="position: absolute; top: 3px; left: 10px">
    <div style="font-size: x-large; font-family: 'Microsoft Himalaya'; font-style: inherit; color: white">管理员{{seller.sellername}}，欢迎您！</div>
    <a href="#/updatePassWord" style="text-decoration: none"><div style="font-size: small; font-family: 'Microsoft Himalaya'; font-style: italic; color: white">修改密码</div></a>
    <a href="" style="text-decoration: none"><div style="font-size: small; font-family: 'Microsoft Himalaya'; font-style: italic; color: white; float: left">退出登录</div></a>
  </div>
</div>
</template>

<script>
export default {
  name: "setting",
  data() {
    return {
      seller: {
        "sellername": "",
      },
      flag: true
    }
  },
  methods: {
    index: function (value) {
      if (value === "商品状态") {
        this.$router.push({
          name: 'temp',
          params: {
            'value': '商品状态',
            'flag': true
          }
        })
      } else if (value === "历史商品") {
        this.$router.push({
          name: 'temp',
          params: {
            'value': '历史商品'
          }
        })
      } else if (value === "购买人信息") {
        this.$router.push({
          name: 'temp',
          params: {
            'value': '购买人信息'
          }
        })
      } else if (value === "发布商品") {
        this.$router.push({
          name: 'upload',
          params: {
            'value': '发布商品'
          }
        })
      }
    }
  },
  created() {
    this.$http.post("http://rap2api.taobao.org/app/mock/293261/seller").then(res => {
      this.seller.sellername = res.data.sellername;
    })
    this.$http.post("http://rap2api.taobao.org/app/mock/293261/home/data").then((res) =>{
      this.flag = res.data.goods[0].freeze;
    })
  }
}
</script>

<style scoped>
#main {
  background-size: 100% 100%;
  height: 100%;
  position: fixed;
  width: 100%
}
.navbar {
  margin-bottom: 0;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9999;
}
#titleText{
  background: none;
  font-size: 96px;
  color: whitesmoke;
  transition-duration: 0.4s;
  border: none;
  width: 100%;
  text-decoration: none;
  cursor:pointer;
  text-align: center;
  letter-spacing: 5px;
}
a.astyle{
  background-color: #037bd2;
  font-size: xx-large;
  color: whitesmoke;
  transition-duration: 0.4s;
  border: none;
  width: 100%;
  text-decoration: none;
  cursor:pointer
}
.astyle:hover{
  color: lightgray;
}
.bd{
  margin-top: 10%;
  margin-left: 20%;
  margin-right: 20%;
  height: 70%;
}
.dh{
  height: 33.3%;
  width: 100%;
  writing-mode: vertical-lr;
  font-size: xx-large;
  font-family: "Microsoft Himalaya";
  color: white;
  text-align: center;
  cursor: pointer;

}
.button1{
  margin: 0 auto;
  background-color: salmon; /* Green */
  border: none;
  color: white;
  margin-top: 5%;
  padding: 15px 30px;
  width: 200%;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 32px;
  border-radius: 5px;
}
.button1:active {
  background-color: #e4b9c0;
  box-shadow: 0 5px #d9edf7;
  transform: translateY(4px);
}
.sp1 {
  color: white;
  font-style: inherit;
  margin: 0 auto;
  font-family: "Microsoft Himalaya";
  font-size: 72px;
  text-align: center;
  background: #037bd2;
  border-radius: 10px;
  padding-top: 5%;
  padding-bottom: 5%;
  margin-left: 5%;
  margin-right: 5%;
  opacity: 0.8;
}
.sp2 {
  color: white;
  font-style: inherit;
  margin: 0 auto;
  font-family: "Microsoft Himalaya";
  font-size: 72px;
  text-align: center;
  background: #037bd2;
  border-radius: 10px;
  padding-top: 5%;
  padding-bottom: 5%;
  margin-left: 5%;
  margin-right: 5%;
  opacity: 0.8;
  display: inline-block;
  width: 90%;
}
td {
  text-align: center;
  margin: 0 auto;
  /*background: #037bd2;*/
  max-width: 60%;
  height: 210px;
}
.sp1:hover {
  transform: scale(1.2);
  border: yellow 8px;
  border-style: solid;
  transition: all 0.5s;
  cursor: pointer;
  box-shadow: inset 0 1px 1px white,0 0 8px snow;
  opacity: 1;
}

</style>
